'use strict';

angular.module('app')
	.controller('sceneApplyController', [ '$rootScope', '$scope', '$http', '$state',
	                                function($rootScope, $scope, $http, $state) {
		$scope.title = '报名管理';
        $scope.param = { };
        $scope.loading = false;
		$scope.search = function () {
	        $scope.loading = true;
			$.ajax({
				url : $scope.app.project_name + '/apply/read/list',
				data: $scope.param
			}).then(function(result) {
		        $scope.loading = false;
				if (result.httpCode == 200) {
					$scope.pageInfo = result.data;
				} else {
					$scope.msg = result.msg;
				}
				$scope.$apply();
			});
		}
		
		$scope.search();
		
		$scope.clearSearch = function() {
			$scope.param.keyword= null;
            $scope.param={};//将输入的数据清空
			$scope.search();
		}
		$scope.teamPeopleList = function(id) {
            $.ajax({
                url : $scope.app.project_name + '/apply/read/teamPeopleList',
                data: id
            }).then(function(result) {
                if (result.httpCode == 200) {
                    $scope.count = result.data.length;
                    $scope.peopleList = result.data;
                } else {
                    $scope.msg = result.msg;
                }
                $scope.$apply();
            });
            $('#teamPeopleList').modal('show',true);
		}
		// 翻页
        $scope.pagination = function (page) {
            $scope.param.pageNum=page;
            $scope.search();
        };
       
} ]);